package org.yjw.service.areacode.impl;

import org.apache.ibatis.session.SqlSession;
import org.yjw.dao.areacode.AreaCodeMapper;
import org.yjw.entity.areacode.AreaCode;
import org.yjw.service.areacode.AreaCodeService;
import org.yjw.util.MyBatisUtil;

import java.util.List;

public class AreaCodeServiceImpl implements AreaCodeService {

    private static AreaCodeMapper areaCodeMapper;

    static {
        SqlSession sqlSession = MyBatisUtil.getSqlSession();
        areaCodeMapper = sqlSession.getMapper(AreaCodeMapper.class);
    }


    @Override
    public List<AreaCode> getAll() {
        return areaCodeMapper.getAll();
    }

    @Override
    public Integer addAreaCode(AreaCode areaCode) {
        return areaCodeMapper.addAreaCode(areaCode);
    }

    @Override
    public AreaCode findById(Long id) {
        AreaCode areacode = areaCodeMapper.findById(id);
        return areacode;
    }
}
